const puppeteer = require('puppeteer');

const appleUrl = 'https://www.apple.com.cn';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto(appleUrl, { waitUntil: 'networkidle2' });
  await page.pdf({ path: 'deploys/apple.pdf', format: 'A4' });
  await browser.close();
})();
